package com.tian;

import java.util.HashSet;
import java.util.TreeMap;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) {
        //1,1
        //2,2
        //3
        Integer[] aa = {1, 1,3, 2, 2};
        TreeMap<Integer, Integer> treeMap = new TreeMap<>();
        for (Integer integer : aa) {
            Integer newKey = integer * 10;
            Integer v = treeMap.get(newKey);
            if (v == null) {
                treeMap.put(newKey, integer);
            } else {
                treeMap.put(newKey + 1, integer);
            }
        }
        System.out.println(treeMap);


        //value---key
        //1----10
        //1----11
        //2----20
        //2----21
        //3----30

    }
}
